﻿using System;

using Fuse8.DomainFramework.Domain;

using Fuse8.ContentManagementFramework.Domain.Commands.CommandParameters;
using Fuse8.ContentManagementFramework.Domain.Special;

namespace Fuse8.ContentManagementFramework.Domain.Commands
{
    public abstract class CmsEntityRevisionUpdateCommand<TEntity> : BaseEntityParameterCommand<TEntity, CmsEntityRevisionUpdateCommandParameter>
        where TEntity : class, IEntityObject<int>
    {
        private readonly string _typeParameter = typeof(TEntity).Name;

        public override string CacheKey
        {
            get
            {
                return string.Format("EntityId_{0};EntityType_{1}",
                    CommandParameter.EntityId,
                    CommandParameter.EntityTypeParameter);
            }
        }

        public override string CommandName
        {
            get
            {
                return string.Format("Cms{0}CmsEntityRevisionUpdateCommand", _typeParameter);
            }
        }
    }
}
